import { App } from 'vue'
import dayjs from 'dayjs'
export function dateFormatDirect(app: App) {
  app.directive('dateFormat', (el, binding: any) => {
    const elText = el.textContent
    let format = binding.value
    if (!binding.value) format = 'YYYY-MM-DD:HH:mm:ss'
    const formatDate = dayjs(elText).format(format)
    el.textContent = formatDate
  })
}
